home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 002 / index13.arc / INDEX13.DOC < prev   
Encoding:
Text File  |  1984-10-14  |  10.0 KB  |  285 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                                    INDEX V1.3
  9.  
  10.  
  11.         July 26, 1984
  12.  
  13.  
  14.         Released to the public domain by its author for non-comercial use 
  15.         only  by Gary Elfring.   Copies made be made of this program pro-
  16.         vided no charge is made for them.   This product may not be  sold 
  17.         or made part of any package that is sold.
  18.  
  19.  
  20.         Introduction
  21.  
  22.              INDEX  is  a  program that produces an index from  any  text 
  23.         file.   It  requires two input files- the text to search  through 
  24.         and  a  list of keywords or phrases to search  for.   INDEX  will 
  25.         handle any type of text file- including thouse produced by  Word-
  26.         Star or other word processors.   INDEX was designed after I got a 
  27.         good look at MicroPro's StarIndex program.  INDEX does everything 
  28.         you  would  expect from an index program,  while  StarIndex  does 
  29.         little if anything.
  30.  
  31.              INDEX  will  run in a small amount of memory (64K) and  will 
  32.         handle  text files of any length.   In operation INDEX  generates 
  33.         temporary  working copies of your input text and  keyword  files.  
  34.         These  copies  have  the most significant bit of  each  character 
  35.         stripped and,  depending on the option selected,  all  characters 
  36.         may  be  converted to upper case.   Use of upper case only  eases 
  37.         search  requirements.   Thus to work INDEX requires an amount  of 
  38.         free  disk space equal to your text file size plus  keyword  file 
  39.         size.   More space is required if the output of INDEX is directed 
  40.         to the disk.
  41.  
  42.              INDEX is not the fastest program you have ever seen.  It was 
  43.         written and compiled with an optimizing C compiler,  however,  it 
  44.         takes a fair amount of time to search large files.  On a RAM disk 
  45.         a  50K  file  can  be indexed for 100 keywords in  about  8  - 10 
  46.         minutes.   Time  is somewhat dependent on the length of the  key-
  47.         words or phrases.   NOTE- no keyword or phrase may be longer than 
  48.         70 characters in length.  Also INDEX will not locate phrases that 
  49.         wrap  from  one line to the next if the text  being  searched  is 
  50.         indented- as is the case with WordStar files.
  51.  
  52.  
  53.         Operation
  54.  
  55.              The  INDEX  program is easy to use.   A text file  is  first 
  56.         created.   Next  a list of keywords or phrases is created as  the 
  57.         next section describes.  The INDEX program only needs the name of 
  58.         the  text file,  an the name of the keyword list.   It will  also 
  59.         take some simple options.  To run you simply type:
  60.  
  61.  
  62.  
  63.                                         1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                                   INDEX V1.3
  71.  
  72.  
  73.         INDEX text.ext keywords.ext [opt1 opt2 opt3]{cr}
  74.  
  75.         NOTE:     {cr} stands for the newline/enter/carriage return key.
  76.                   The  [opt1 opt2 opt3] indicates optional commands  that 
  77.                   may be passed to the program.   Up to 3 options may  be 
  78.                   passed.  Options may be one of the following:
  79.  
  80.                   D =  redirect  output to a  disk file  instead  of  the 
  81.                        printer.
  82.  
  83.                   S =  redirect output to screen instead of the printer.
  84.  
  85.                   C =  instructs  program to  pay attention to upper  and 
  86.                        lower case.   Use with care since 'The' is not the 
  87.                        same as 'the'.
  88.  
  89.                 xxx =  where xxx is any number from 1 to 999.   Instructs 
  90.                        INDEX  to use the supplied number as the  starting 
  91.                        page  number.   Thus you can break long blocks  of 
  92.                        text  up and still get indexes that can be  merged 
  93.                        together.
  94.  
  95.         NOTE2:    Options 'S' and 'D' may not be used together.  I.E. the 
  96.                   output  may only be sent to one of  three  places,  not 
  97.                   both screen and disk files.
  98.  
  99.  
  100.                                     EXAMPLES
  101.  
  102.         INDEX test.txt key.txt{cr}
  103.  
  104.         (Produce an index of file test.txt based on keyword list key.txt.  
  105.         Pay  no  attention to upper/lower case.   Output is sent  to  the 
  106.         printer by default.)
  107.  
  108.  
  109.         INDEX test.txt key.txt d c{cr}
  110.  
  111.         (Produce an index of file test.txt based on keyword list key.txt.  
  112.         Pay attention to upper and lower case.   Output is sent to a disk 
  113.         file with the same name specified by the input file,  but with an 
  114.         extension of ".ind".  [test.ind])
  115.  
  116.  
  117.         INDEX test.txt key.txt s{cr}
  118.  
  119.         (Produce an index of file test.txt based on keyword list key.txt.  
  120.         Pay  no  attention to upper/lower case.   Output is sent  to  the 
  121.         screen.)
  122.  
  123.         INDEX test.txt key.txt s 24{cr}
  124.  
  125.         (Produce  the  same  index as the  example  above,  EXCEPT,  page 
  126.         numbers will be offset by 24.   If the first keyword was found on 
  127.  
  128.  
  129.                                         2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.                                   INDEX V1.3
  137.  
  138.  
  139.         page 1 in the first example,  then this time it will appear as if 
  140.         it was found on page 24.)
  141.  
  142.  
  143.              INDEX will respond by typing out the options,  if any,  that 
  144.         you have specified and then printing the "Creating temporary work 
  145.         files" message.  After the program has created the work files, (5 
  146.         to 10 seconds), it will proceed to the actual text file indexing.  
  147.         The  program  will locate the first keyword or phrase and  search 
  148.         through all of you text file for it.  Each matching entry will be 
  149.         sent  to  the output device selected by you,  after  the  keyword 
  150.         phrase, in the form of page number - line number.
  151.  
  152.              All  errors in file handling and creation will be caught and 
  153.         appropriate  error message sent to the screen.   In a  trial  run 
  154.         on  a hard disk INDEX managed to produce an index of a 450K  file 
  155.         with 120 keywords in under 3 hours and 15 minutes.  Doing the job 
  156.         by hand would have taken days and produced many mistakes.
  157.  
  158.  
  159.         Keyword Files
  160.  
  161.              The keyword files do have to be in a somewhat special format 
  162.         to  work  correctly.   The INDEX program expects to see a  single 
  163.         keyword or phrase on each line of the keyword file.   INDEX  also 
  164.         searches for an exact match to the keyword.  Thus to find plurals 
  165.         or  slight  variations in spelling of a keyword or phrase  it  is 
  166.         best  to  shorten  the keyword down to the lowest common  set  of 
  167.         characters  possible.   A keyword file would look something  like 
  168.         this:
  169.  
  170.  
  171.         Accuracy
  172.         Assembly language
  173.         Basic
  174.          C
  175.          debug
  176.         EPROM
  177.          jump
  178.         High level language
  179.         Input
  180.  
  181.  
  182.              Some comments about this file are needed now.  Since case is 
  183.         ignored by the program its only use is for your  convience.   The 
  184.         program  will pay no attention to it.   Locating certain words is 
  185.         quite  difficult  for  the program.   Finding  C,  as  in  the  C 
  186.         programming  language,  can cause a problem.   If just the single 
  187.         letter  C is to be searched for you will get a lot  of  incorrect 
  188.         matches.   The  easy way around this is to add a space before and 
  189.         after  the  letter  C in your keywords  list.   This  forces  the 
  190.         program   to  search  for  space-C-space{cr},   a  more  reliable 
  191.         indicator  of the word C.   Finally,  to catch all references  to 
  192.         debugging  a program a keyword of space-DEBUG{cr} might be  used.  
  193.  
  194.  
  195.                                         3
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.                                   INDEX V1.3
  203.  
  204.  
  205.         This  will  catch all words that start with  the  letters  DEBUG.  
  206.         This  includes debug,  debugs,  debugging,  etc.   The same  rule 
  207.         applies  to  plurals.   All  extra  letters should  be  left  off 
  208.         keywords.
  209.  
  210.  
  211.         Output
  212.  
  213.              The  program output is sent to the source selected  by  you.  
  214.         The  keyword  or  phrase  to be searched  for  is  printed  first 
  215.         followed  by  a ":" and two spaces.   The program will then  send 
  216.         page and line number combinations out in the form PPP-LL until no 
  217.         more  matches for that keyword can be found.   A number like 3-45 
  218.         indicates that a match for that keyword was found on page 3, line 
  219.         45.  A sample index follows:
  220.  
  221.  
  222.         Accuracy:    5-40  15-21  23-04 
  223.         Assembly language:
  224.         Basic:       1-05   2-12   2-14   2-34   2-43   2-56   3-31
  225.               3-45   3-50  14-02  14-12  15-10  16-12  16-15  17-08
  226.              18-04  19-34  19-39
  227.          C:   4-55   5-13
  228.          debug:      1-13   1-45   2-33   5-45   6-54   6-55
  229.         EPROM:      10-14
  230.          jump:      14-13  14-23  14-56
  231.         High level language:      12-32  13-45  15-56
  232.         Input:       1-34   3-19   7-8
  233.  
  234.  
  235.         If  you are using this program and find it of value you may  want 
  236.         to become a registered user.   As a registered user you are enti-
  237.         tled  to the source code,  updates,  and help with  the  program.  
  238.         (The  source  is written in C and will be sent to the  registered 
  239.         user  provided  he has sent a formated disk with  self  addressed 
  240.         stamped  mailer.)  A contribution of $35.00 is required to become 
  241.         a registered user.  Please send same to:
  242.  
  243.                 Gary Elfring
  244.                 4N899 W. Mary Drive
  245.                 St. Charles, Illinois
  246.                 60174
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                         4
  262.  
  263.  
  264.  
  265.  Illinois
  266.                 60174
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.                                         4
  282.  
  283.  
  284.  
  285.